part of '../repository.dart';

class _TimeDto extends Equatable {
  const _TimeDto._internal({
    required this.timeString,
  });

  final String timeString;

  @override
  List<Object?> get props {
    return [
      timeString,
    ];
  }

  factory _TimeDto.fromString(String timeString) {
    return _TimeDto._internal(
      timeString: timeString,
    );
  }

  factory _TimeDto.fromEntity(DateTime time) {
    return _TimeDto._internal(
      timeString: time.toIso8601String(),
    );
  }

  @override
  String toString() {
    return timeString;
  }

  DateTime toEntity() {
    return DateTime.parse(timeString);
  }
}
